var webpack = require('webpack');
var path = require('path');
module.exports = {
     entry: [
        'webpack-dev-server/client?http://0.0.0.0:3000', // WebpackDevServer host and port
        'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
         './src/app.js',
     ],
     output: {
         path: './build/',
         publicPath: '/build',
         filename: 'bundel.js'
     },
     module: {
        loaders: [
            {
                test: /\.js?$/,
                include: path.join(__dirname, 'src'),
                loader: 'react-hot'
            },
            {
                test: /\.js?$/,
                include: path.join(__dirname, 'src'),
                loader: 'babel', // 'babel-loader' is also a legal name to reference
                query:{
                  presets: ['react', 'es2015']
                }
            }
        ],
    },
    plugins:[
        new webpack.DefinePlugin({
          'process.env': {
            NODE_ENV: JSON.stringify('production')
          }
        })
    ]
 };